/**
 *     tipple is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    tipple is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with tipple.  If not, see <http://www.gnu.org/licenses/>.
 * Copyright 2009 James Osler, Adam Tomkins

 */



package v0_4;

//~--- JDK imports ------------------------------------------------------------

import java.util.*;

/**
 *
 * @author Jamie
 */
public class IdGen {
    public IdGen() {}

    // List<Beer> beerList;
    public int uniqueID(List<Beer> beerList) {
        Random generator = new Random();
        int    uid       = generator.nextInt();

        uid = Math.abs(uid);

        for (int i = 0; i < beerList.size(); i++) {
            if (uid == beerList.get(i).getid()) {
                uniqueID(beerList);
            }
        }

        return uid;
    }
/**
    public static void main(String[] args) {
        Random generator = new Random();
        int    uid       = generator.nextInt();

        uid = Math.abs(uid);
        System.out.println(uid);
    }
 **/
}


//~ Formatted by Jindent --- http://www.jindent.com
